<template>
  <div>
    <h1>{{ props }}</h1>
    msg1:  {{msg1}}<br>
    obj1:  {{obj1}}<br>

  </div>
</template>

<script setup>
import { defineProps, reactive, toRef } from 'vue'

const props = defineProps({
  msg: String,
  obj: Object
})

const state = reactive({ count: 0 })

const msg1 = toRef(props, 'msg')

const obj1 = toRef(props, 'obj')

setTimeout(() => {
  msg1.value = '22222'
  obj1.value.name = '子控件赋值'
}, 1000)

</script>

<style scoped>
a {
  color: #42b983;
}
</style>
